
package com.ddtech.business.bank.bo;

import com.ddtech.business.bank.entity.QuestionBankQuestion;
import com.ddtech.business.bank.entity.QuestionBankQuestionOption;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.List;

@ApiModel
@Data
public class BankQueAndOpt {

    /**
     * 题目id
     */
    @ApiModelProperty("题目id")
    private String id;

    /**
     * 题库id
     */
    @ApiModelProperty("题库id")
    private String bankId;

    /**
     * 题目题号
     */
    @ApiModelProperty("题目题号")
    private int questionNum;

    /**
     * 题目描述
     */
    @ApiModelProperty("题目描述")
    private String questionDesc;

    /**
     * 题目附件图片
     */
    @ApiModelProperty("题目附件图片")
    private String questionImg;

    /**
     * 题目类型 0单选 1多选
     */
    @ApiModelProperty("题目类型 0单选；1多选")
    private Integer optionType;


    /**
     * 分值
     */
    @ApiModelProperty("分值")
    private Double score;



    @ApiModelProperty(value = "安规专业类别")
    private String majorType;


    @ApiModelProperty(value = "专业类别id")
    private String majorId;

    @ApiModelProperty(value = "依据规定制度名称（文号）、条款、条款内容")
    private String basis;

    @ApiModelProperty(value = "难易程度")
    private String difficulty;

    @ApiModelProperty(value = "试题关键词")
    private String keywords;


    @ApiModelProperty(value = "是否删除0,1")
    private Integer isDelete;

    /**
     * 题目选项列表
     */
    @ApiModelProperty("题目选项列表")
    private List<QuestionBankQuestionOption> lists;

    public BankQueAndOpt() {
    }

    public BankQueAndOpt(QuestionBankQuestion questionBankQuestion) {
        this.id = questionBankQuestion.getId();
        this.bankId = questionBankQuestion.getBankId();
        this.questionNum = Math.toIntExact(questionBankQuestion.getQuestionNum());
        this.questionDesc = questionBankQuestion.getQuestionDesc();
        this.questionImg = questionBankQuestion.getQuestionImg();
        this.optionType = questionBankQuestion.getOptionType();
        this.score = questionBankQuestion.getScore();
        this.majorType=questionBankQuestion.getMajorType();
        this.majorId=questionBankQuestion.getMajorId();
        this.basis=questionBankQuestion.getBasis();
        this.difficulty=questionBankQuestion.getDifficulty();
        this.keywords=questionBankQuestion.getKeywords();
        this.isDelete=questionBankQuestion.getIsDelete();
    }

}
